package com.zhang.springcloud.controller;

import com.zhang.springcloud.entities.CommonResult;
import com.zhang.springcloud.entities.Payment;
import com.zhang.springcloud.service.OrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class OrderFeignController {
    @Autowired
    OrderFeignService orderFeignService;
    @GetMapping("/feign/select/{id}")
    public CommonResult<Payment> select(@PathVariable("id") Long id){
        return orderFeignService.select(id);
    }
    @PostMapping("/feign/add")
    public CommonResult<Payment> add(@RequestBody Payment payment){
        return orderFeignService.create(payment);
    }
    @GetMapping("/payment/feigntimeout")
    public String getFeignTimeout(){
        return orderFeignService.getFeignTimeout();
    }
}
